package one.stand.model;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.springframework.util.StringUtils;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author Administrator
 */
@Data
public class DynamicModel extends BaseModel implements Serializable {
    private Integer dynamicId;

    private Integer companyId;

    private String companyName;

    /**
     * 标题
     */
    private String title;

    /**
     * 类型 1:文章 2:动态 3:转载
     */
    private Integer type;

    /**
     * 图片 封面
     */
    private String photos;

    /**
     * 详情
     */
    private String details;

    private String url;

    /**
     * 当前作者
     */
    private String author;

    /**
     * 原始作者，如转载文章的来源公众号
     */
    private String originAuthor;

    /**
     * 发布人ID
     */
    private Integer createUserId;

    /**
     * 是否是草稿 1草稿 0 发布
     */
    private Integer isDrafts;

    /**
     * 文章分类id
     */
    @ApiModelProperty(name = "获客文章分类")
    private Integer essayTypeId;

    /**
     * 发布时间
     */
    private Date pubTime;

    private String companyLogo;

    private String companyPhone;

    private String companyNotice;

    private String industryId;

    private String recruitPhone;

    private String doThumbsName;

    private Integer doThumbsNum;

    private Integer isThumbs;

    private Integer userId;

    private Integer commentNum;

    private String nickeName;

    private List<CommentModel> commentModelList;

    private String startTime;

    private String endTime;

    /**
     * 分享次数
     */
    private Integer shareNum;

    /**
     * 阅读次数
     */
    private Integer readNum;

    /**
     * 阅读时长
     */
    private Integer readTime;

    public String getNickeName() {
        return StringUtils.isEmpty(nickeName)?"":new String(java.util.Base64.getDecoder().decode(nickeName));
    }
}
